/**
 *  全局的一些公共方法
 *  Created by lihao on 2018.02.06
 */
//
// function Deferred() {
//   this.promise = new Promise(function (resolve, reject) {
//     this._resolve = resolve;
//     this._reject = reject;
//   }.bind(this));
// }
// Deferred.prototype.resolve = function (value) {
//   this._resolve.call(this.promise, value);
// };
// Deferred.prototype.reject = function (reason) {
//   this._reject.call(this.promise, reason);
// };

const tools = {
  sendJson: function(res, data) {
    res.end(JSON.stringify(data))
  }
}

module.exports = tools
